import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { MemberCenterHomeComponent } from './member-center-home/member-center-home.component';
import { MemberCenterMessageDetailComponent } from './member-center-message-detail/member-center-message-detail.component';
import { MemberCenterWithdrawalComponent } from './member-center-withdrawal/member-center-withdrawal.component';
import { MemberCenterTransferComponent } from './member-center-transfer/member-center-transfer.component';
import { MemberCenterTransferSuccessComponent } from './member-center-transfer-success/member-center-transfer-success.component';
import { MemberCenterMessageListComponent } from './member-center-message-list/member-center-message-list.component';

const routes: Routes = [
    {
        path: '',
        children: [
            {
                path: '',
                redirectTo: 'home',
            },
            {
                path: 'home',
                component: MemberCenterHomeComponent,
                data: {
                    title: '个人中心',
                    translate: 'member-center.home'
                }
            },
            {
                path: 'withdrawal',
                component: MemberCenterWithdrawalComponent,
                data: {
                    title: '提现',
                    translate: 'Drawal'
                }
            },
            {
                path: 'transfer',
                component: MemberCenterTransferComponent,
                data: {
                    title: '转账',
                    translate: 'Transfer'
                }
            },
            {
                path: 'transfer/success',
                component: MemberCenterTransferSuccessComponent,
                data: {
                    title: '转账',
                    translate: 'Transfer'
                }
            },
            {
                path: 'messageListPage',
                component: MemberCenterMessageListComponent,
                data: {
                    title: '消息列表',
                    translate: 'Message-List'
                }
            },
            {
                path: 'message',
                component: MemberCenterMessageDetailComponent,
                data: {
                    title: '消息详情',
                    translate: 'Message-Detail'
                }
            },
            {
                path: '**',
                redirectTo: 'home',
            },
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class MemberCenterRoutingModule { }
